Skip to content

[6.2] Prevent accessing unicode scalar element with incorrect index. (#1214) #1219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sofiaromorales
Copy link
Contributor

Explanation: This change prevents a potential DocC crash by making sure that it does not access an array element using an index that is outside of the bonds of the array.
Scope: Fixes crash of some documentation when building with Linux and Swift 5.9
Issues: rdar://150760264
Original PRs: #1214
Risk: Low.
Testing: Automated tests have been added and manual test has been made.
Reviewers: @anferbui @d-ronnqvist @QuietMisdreavus @patshaughnessy

…lang#1214)

This change prevents a potential DocC crash by making sure that it does not access
an array element using an index that is outside of the bonds of the array.

`.index(after:` can crash in some cases if the passed index
belongs to the last element of the collection. with this change we ensure
that the passed index is not the last index.

rdar://150760264
@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

@sofiaromorales sofiaromorales merged commit 5065f71 into swiftlang:release/6.2 May 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants